package com.example.medicine.Mapper;

import com.example.medicine.Bean.Team;
import com.example.medicine.Bean.zhengzhuang;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface xyjbMapper {
    /**
     * 从zhengzhuang表中查询全部
     * 西医疾病信息
     * @return
     */
    @Select("select * from [zhengzhuang] where fenlei='西医'")
    List<zhengzhuang> getAll();

    @Select("select * from [zhengzhuang] where id=#{id} and fenlei='西医'")
    zhengzhuang getById(int id);
    /**
     * 向zhengzhuang表中插入西医疾病信息
     */
    @Insert("insert into [zhengzhuang](bianhao, mingcheng, buwei,tezheng,bingli,fenlei) values(#{bianhao}, #{mingcheng}, #{buwei},#{tezheng},#{bingli},'西医')")
    void insert(zhengzhuang zhengzhuang);

    /**
     * 更新zhengzhuang表，根据主键（ID）更新
     * @param zhengzhuang
     */
    @Update("update [zhengzhuang] set bianhao=#{bianhao}, mingcheng=#{mingcheng}, buwei=#{buwei}, tezheng=#{tezheng},bingli=#{bingli} where id=#{id} and fenlei='西医'")
    void update(zhengzhuang zhengzhuang);

    /**
     * 根据id删除zhengzhuang表中记录
     * @param id
     */
    @Delete("delete from [zhengzhuang] where id=#{id}")
    void deleteById(int id);
}
